package com.nexgo.payment.trans.setting.transmanage;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.nexgo.payment.R;
import com.nexgo.payment.ui.ListMenuActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * 交易管理设置
 */
public class TransSwitchActivity extends ListMenuActivity {
    private List<Integer> mItemList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
    }

    @Override
    protected String getActivityTitle() {
        return getString(R.string.trans_management_settings);
    }

    private void initView() {
        mItemList = new ArrayList<>();
        mItemList.add(R.string.traditional_class_trans_control);
        mItemList.add(R.string.settle_class_trans_control);
        mItemList.add(R.string.rf_parameter_settings);
        mItemList.add(R.string.trans_swipe_control);
        mItemList.add(R.string.other_class_settings);
        for (Integer i : mItemList) {
            addItem(i);
        }
    }

    @Override
    protected void onItemClick(int position) {
        int item = mItemList.get(position);
        switch (item) {
            case R.string.traditional_class_trans_control:
                intent2Activity(SetupTransSwitchActivity.class);
                break;
            case R.string.settle_class_trans_control:
                intent2Activity(SetupSettleSwitchActivity.class);
                break;
            case R.string.rf_parameter_settings:
                intent2Activity(SetupRfParameterActivity.class);
                break;
            case R.string.trans_swipe_control:
                intent2Activity(SetupCardSwitchActivity.class);
                break;
            case R.string.other_class_settings:
                intent2Activity(SetupOtherSwitchActivity.class);
                break;
            default:
                break;
        }
    }

    public static Intent newInstance(Context context) {
        return new Intent(context, TransSwitchActivity.class);
    }
}
